package models;
 
import java.math.BigDecimal;
import java.util.*;

import javax.persistence.*;
 
import play.data.validation.Required;
import play.db.jpa.*;
 
@Entity
public class FundPriceHistory extends Model {
	@Required
	@ManyToOne
	public Fund fund;
	
	@Required
	public Date price_date;
	
	@Required
	public BigDecimal price;
	
	public FundPriceHistory(Fund fund, Date price_date, BigDecimal price) {
		this.fund = fund;
		this.price_date = price_date;
		this.price = price;
	}
	
	public FundPriceHistory(Fund fund){
		this.fund = fund;
	}
	
	public String toString() {
		return this.fund + " - " + this.price_date.toString();
	}
}